<?php Yii::app()->clientScript->registerScriptFile(bu() .'/js/fileuploader_scripts.js'); ?>
<?php
$prefix = isset($prefix) ? $prefix : '';
$id_var_name = md5($prefix.$var_name); ?>
<script type="text/javascript">
	var id_var_name = "<?php echo $id_var_name ?>";
	var label_id = "";

	if (typeof(custom_labels) == "undefined") {
		custom_labels = {};
	}

	custom_labels[id_var_name] = {};
	custom_labels[id_var_name]['upload_another_file'] = "Local";
	custom_labels[id_var_name]['upload_file'] = "Local";
</script>

<div class="fileuploader">
	<input type="hidden" id="" value="" />
	<div class="nowrap" id="file_uploader_<?php echo $id_var_name ?>">
		<div class="upload-file-section" id="message_<?php echo $id_var_name ?>" title="">
			<p class="cm-fu-file hidden"><img src="<?php echo bu() ?>/images/icons/icon_delete.gif" width="12" height="18" border="0" hspace="3" id="clean_selection_<?php echo $id_var_name ?>" alt="Xóa" title="Xóa" onclick="fileuploader.clean_selection(this.id); fileuploader.toggle_links(this.id, 'show'); fileuploader.check_required_field('<?php echo $id_var_name ?>', '');" class="hand valign" /><span></span></p>
			<p class="cm-fu-no-file "><?php echo t('Select a file or enter URL') ?></p>
		</div>

		<div class="select-field upload-file-links " id="link_container_<?php echo $id_var_name ?>">
			<input type="hidden" name="file_<?php echo $var_name ?>" value="<?php echo $image_name ?>" id="file_<?php echo $id_var_name ?>" />
			<input type="hidden" name="type_<?php echo $var_name ?>" value="<?php if ( $image_name ) echo 'local'; ?>" id="type_<?php echo $id_var_name ?>" />
			<div class="upload-file-local">
				<input type="file" name="file_<?php echo $var_name ?>" id="_local_<?php echo $id_var_name ?>" onchange="fileuploader.show_loader(this.id);  fileuploader.check_required_field('<?php echo $id_var_name ?>', '');" onclick="$(this).removeAttr('value');" value="" />
				<a id="local_<?php echo $id_var_name ?>">Local</a>
			</div>
			&nbsp;&nbsp;|&nbsp;&nbsp;
<!--			<a onclick="fileuploader.show_loader(this.id);" id="server_<?php echo $id_var_name ?>">Server</a>
			&nbsp;&nbsp;|&nbsp;&nbsp;-->
			<a onclick="fileuploader.show_loader(this.id);" id="url_<?php echo $id_var_name ?>">URL</a>
		</div>

	</div>
</div><!--fileuploader-->